home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / RADIOLOS.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  5.3 KB  |  208 lines

  1. 10  'RADIOLOS - 14 OCT 86 rev. 27 SEP 96
  2. 20  '
  3. 30  'ADAPTED FROM THE FOLLOWING ARTICLE from QST, July 1983:
  4. 40  '   RADIO LINE-OF-SIGHT
  5. 50  '   by W6ZGN, Jack Priedigkeit
  6. 60  '   441 Sherwood Way, Menlo Park CA 94025
  7. 70  '
  8. 80  CLS:KEY OFF
  9. 90  IF EX$=""THEN EX$="EXIT"
  10. 100  COLOR 7,0,1
  11. 110  UL$=STRING$(80,205)
  12. 120  DIM TXT$(20)
  13. 130  '
  14. 140  '.....start
  15. 150  CLS
  16. 160  COLOR 15,2
  17. 170  PRINT " LINE-of-SIGHT RADIO WAVES";
  18. 180  PRINT TAB(57);"by George Murphy VE3ERP ";
  19. 190  COLOR 1,0:PRINT STRING$(80,223);
  20. 200  COLOR 7,0
  21. 210  GOSUB 1810    'preface
  22. 220  PRINT UL$;
  23. 230  PRINT " Press number in < > to choose standard units of measure:"
  24. 240  PRINT UL$;
  25. 250  PRINT "  < 1 >  Metric"
  26. 260  PRINT "  < 2 >  U.S.A./Imperial"
  27. 270  PRINT UL$;
  28. 280  PRINT "    or Press < 0 > to EXIT....."
  29. 290  Z$=INKEY$
  30. 300  IF Z$="0"THEN CLS:RUN EX$
  31. 310  IF Z$="1"THEN D$="km.":H$="m.":GOTO 340
  32. 320  IF Z$="2"THEN D$="mi.":H$="ft.":GOTO 340
  33. 330  GOTO 290
  34. 340  PRINT UL$;
  35. 350  PRINT " Press number in < > to:
  36. 360  PRINT UL$;
  37. 370  PRINT "  < 3 >  RUN Radio Line-of-Sight program"
  38. 380  PRINT "  < 4 >  RUN Radio Horizon program"
  39. 390  PRINT UL$;
  40. 400  Z$=INKEY$
  41. 410  IF Z$="3"THEN 670
  42. 420  IF Z$="4"THEN 450
  43. 430  GOTO 400
  44. 440  '
  45. 450  '.....radio horizon
  46. 460  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  47. 470  PRINT " (if the data asked for is the data you are seeking, press <ENTER>)"
  48. 480  PRINT
  49. 490  PRINT " ENTER: Height of antenna above average terrain (";H$;").....";
  50. 500  INPUT H:IF H$="m."THEN H=H/0.3048
  51. 510  IF H<>0 THEN D=SQR(2*H):GOTO 560
  52. 520  PRINT " ENTER: Distance of antenna from radio horizon (";D$;")......";
  53. 530  INPUT D:IF D$="Km."THEN D=D*0.62137
  54. 540  IF D<>0 THEN H=D^2/2:GOTO 560
  55. 550  GOTO 490
  56. 560  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  57. 570  PRINT " Height of antenna above average terrain...";USING "#####.#";H;
  58. 580  PRINT " feet  (";
  59. 590  PRINT USING "####.#";H*0.3048;:PRINT " metres)"
  60. 600  PRINT " Approximate distance to radio horizon.....";USING"#####.#";D;
  61. 610  PRINT " miles (";
  62. 620  PRINT USING "####.#";D*1.60935;:PRINT " Km.   )"
  63. 630  PRINT UL$;
  64. 640  LN=6:GOSUB 1950         'screen dump
  65. 650  GOTO 140   'start
  66. 660  '
  67. 670  '.....radio line-of sight
  68. 680  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  69. 690  GOSUB 1490       'preface
  70. 700  IF INKEY$=""THEN 700
  71. 710  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  72. 720  H1$="("+H$+")"
  73. 730  IF LEN(H1$)<11 THEN H1$=H1$+".":GOTO 730
  74. 740  PRINT " ENTER: Elevation of antenna A ";H1$;:INPUT A
  75. 750  X=A:GOSUB 1240:IF M$="1"THEN A=A/0.3048
  76. 760  PRINT " ENTER: Elevation of antenna B ";H1$;:INPUT B
  77. 770  X=B:GOSUB 1240:IF M$="1"THEN B=B/0.3048
  78. 780  D1$="("+D$+")"
  79. 790  IF LEN(D1$)<11 THEN D1$=D1$+".":GOTO 790
  80. 800  PRINT " ENTER: Separation ";D1$;"............";:INPUT D
  81. 810  X=D:GOSUB 1240:IF M$="1"THEN D=D*0.621371
  82. 820  INPUT " ENTER: K factor (if other than 1.33).....";Z
  83. 830  IF Z=0 THEN P=1.33 ELSE P=Z
  84. 840  X=P:GOSUB 1240
  85. 850  COLOR 7,0
  86. 860  CLS
  87. 870  COLOR 2,2:PRINT STRING$(80,32);
  88. 880  COLOR 15,2:LOCATE 1,14
  89. 890  PRINT " LINE-of-SIGHT RADIO WAVE PATH with K-factor of";P"
  90. 900  COLOR 1,0:PRINT STRING$(80,223);
  91. 910  COLOR 7,0
  92. 920  PRINT "Plot  from Antenna A";TAB(31)"from Antenna B";
  93. 930  PRINT TAB(50)"Elevation of ray path"
  94. 940  PRINT UL$;
  95. 950  N=18                'number of plots
  96. 960  LO=A+9.9999E-05:FLAG=0   'factors for low point calculation
  97. 970  C=A-B
  98. 980  K=1.5*P
  99. 990  L=D^2/K
  100. 1000  IF ABS(C)>L THEN 1140
  101. 1010  E=0.75*P*C/D+D/2
  102. 1020  H=A-E^2/K
  103. 1030  '
  104. 1040  FOR Y=0 TO N
  105. 1050  G=Y*D/N
  106. 1060  Q=G-E
  107. 1070  J=H+Q^2/K
  108. 1080  GOSUB 1300           'print line
  109. 1090  NEXT Y
  110. 1100  PRINT UL$;
  111. 1110  LN=24:GOSUB 1950      'screen dump
  112. 1120  GOTO 140   'start
  113. 1130  '
  114. 1140  M=C/D+D/K
  115. 1150  FOR Y=0 TO N
  116. 1160  G=Y*D/N
  117. 1170  J=A-M*G+G^2/K
  118. 1180  GOSUB 1300           'print line
  119. 1190  NEXT Y
  120. 1200  PRINT UL$;
  121. 1210  LN=24:GOSUB 1950
  122. 1220  CLS:RUN EX$
  123. 1230  '
  124. 1240  '.....format display
  125. 1250  LOCATE CSRLIN-1,1:PRINT STRING$(7,32)
  126. 1260  LOCATE CSRLIN-1,42
  127. 1270  PRINT X;SPACE$(10)
  128. 1280  RETURN
  129. 1290  '
  130. 1300  U$="#####,.##"
  131. 1310  IF J<0 THEN COLOR 0,7:CO=1:ELSE COLOR 7,0
  132. 1320  IF M$="1"THEN GG=G/0.621371 ELSE GG=G
  133. 1330  IF M$="1"THEN DD=D/0.621371 ELSE DD=D
  134. 1340  IF M$="1"THEN JJ=J*0.3048 ELSE JJ=J
  135. 1350  PRINT Y+1;
  136. 1360  PRINT TAB(5)USING U$;GG;:PRINT " ";D$;
  137. 1370  IF Y=9 THEN PRINT TAB(20)"(mid-way)";
  138. 1380  PRINT TAB(29)USING U$;ABS(DD-GG);:PRINT " ";D$;
  139. 1390  PRINT TAB(53)USING U$;JJ;:PRINT " ";H$;
  140. 1400  IF JJ<0 THEN LOCATE CSRLIN,67:PRINT "(underground)";
  141. 1410  IF FLAG THEN 1430
  142. 1420  IF J>LO THEN LOCATE CSRLIN-1,67:PRINT"  LOW POINT  ":FLAG=1
  143. 1430  IF Y=0 THEN LOCATE CSRLIN,67:PRINT "(Antenna A)":GOTO 1470
  144. 1440  IF Y=N THEN LOCATE CSRLIN,67:PRINT "(Antenna B)":GOTO 1470
  145. 1450  PRINT ""
  146. 1460  LO=J
  147. 1470  RETURN
  148. 1480  '
  149. 1490  '.....preface
  150. 1500  TB=8      'tab for text
  151. 1510  PRINT TAB(TB);
  152. 1520  PRINT "This program will ask you for a K factor. The K factor accounts"
  153. 1530  PRINT TAB(TB);
  154. 1540  PRINT "for refraction of radio waves close to the surface of the earth."
  155. 1550  PRINT TAB(TB);
  156. 1560  PRINT "For antenna towers less than a couple of thousand feet above the"
  157. 1570  PRINT TAB(TB);
  158. 1580  PRINT "surface a K factor of 1.33 is usually adequate for most line-of-"
  159. 1590  PRINT TAB(TB);
  160. 1600  PRINT "sight calculations over average terrain."
  161. 1610  PRINT
  162. 1620  PRINT TAB(TB);
  163. 1630  PRINT "The program will plot the elevation of the ray path at 19 points"
  164. 1640  PRINT TAB(TB);
  165. 1650  PRINT "along the path between two antennas of any height."
  166. 1660  PRINT
  167. 1670  PRINT TAB(TB);
  168. 1680  PRINT "The elevations shown as minus quantities are the below-ground"
  169. 1690  PRINT TAB(TB);
  170. 1700  PRINT "depths of the line-of-sight path."
  171. 1710  PRINT
  172. 1720  PRINT TAB(TB);
  173. 1730  PRINT "This program is an expanded version of the original program by"
  174. 1740  PRINT TAB(TB);
  175. 1750  PRINT "Jack Priedigkeit W6ZGN."
  176. 1760  PRINT
  177. 1770  PRINT TAB(TB);
  178. 1780  PRINT "Press any key to continue......."
  179. 1790  RETURN
  180. 1800  '
  181. 1810  '.....preface
  182. 1820  T=7
  183. 1830  PRINT TAB(T);
  184. 1840  PRINT "This program computes the height above ground of a radio wave at"
  185. 1850  PRINT TAB(T);
  186. 1860  PRINT "several points along its path between two antennas, assuming the"
  187. 1870  PRINT TAB(T);
  188. 1880  PRINT "ground between the antennas is level. The program also computes"
  189. 1890  PRINT TAB(T);
  190. 1900  PRINT "the distance from the top of an antenna to the radio horizon over"
  191. 1910  PRINT TAB(T);
  192. 1920  PRINT "level ground."
  193. 1930  RETURN
  194. 1940  '
  195. 1950  'HARDCOPY
  196. 1960  GOSUB 2070:LOCATE 25,2:COLOR 14,6
  197. 1970  PRINT " Press 1 to print screen, 2 to print screen & ";
  198. 1980  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  199. 1990  Z$=INKEY$:IF Z$="3"THEN GOSUB 2070:RETURN
  200. 2000  IF Z$="1"OR Z$="2"THEN GOSUB 2070:GOTO 2020
  201. 2010  GOTO 1990
  202. 2020  FOR QX=1 TO 24:FOR QY=1 TO 80
  203. 2030  LPRINT CHR$(SCREEN(QX,QY));
  204. 2040  NEXT QY:NEXT QX
  205. 2050  IF Z$="2"THEN LPRINT CHR$(12)
  206. 2060  GOTO 1960
  207. 2070  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  208.